<!DOCTYPE html>
<#assign f = JspTaglibs["http://www.casic304.cn/f"] />
<#assign SourceDept = JspTaglibs["http://www.casic304.cn/SourceDept"]/>
<html>
<head>
  <meta charset="utf-8">
  <title>靶场零故障信息统计</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
  <link rel="stylesheet" href="${ctx}/qbdmsStatic/iconfont/iconfont.css"/>
  <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/qbdms.css">
  <script type="text/javascript">
    var __ctx = "${ctx}";
  </script>
  <style>
    .table-top-filter .layui-form-label{
      width: 120px;
    }
    .layui-input-block{
      margin-left: 126px;
    }
  </style>
</head>
<body class="listBody">
<div class="qbdms-list">
  <div class="layui-table-view-body">
    <table id="zeroFaultInformationStatisticsTable" lay-filter="zeroFaultInformationStatisticsTable"></table>
  </div>
</div>
<!-- 列表头部工具栏 -->
<script type="text/html" id="zeroFaultInformationStatisticsHeaderToolsBar">
  <div class="ccpui-enterSel">
    <div class="layui-btn-container">
      <@f.a alias="dcfdjscsjxx" event="export" css="layui-btn layui-btn-sm fillBtn" >
<!--      <i class="layui-icon layui-icon-export"></i>-->
      <span>导出</span>
    </@f.a>

    </a>
  </div>
  <form class="layui-form" action="" lay-filter="zeroFaultInformationStatisticsQueryForm">
    <div class="layui-form-body selch" style="margin-top: 4px">
      <div class="table-top-filter layui-row">
        <@SourceDept.dept css="layui-input filter-value" showIn="0" />
        <div class=" qbdms-listForm">
          <label class="layui-form-label">飞行试验开始时间</label>
          <div class="layui-input-block">
            <input type="text" class="layui-input start_time2 filter-value" name="Q_beginTime_DL"
                   placeholder="请输入"/>
          </div>
        </div>
        <div class=" qbdms-listForm">
          <label class="layui-form-label">飞行试验结束时间</label>
          <div class="layui-input-block">
            <input type="text" class="layui-input end_time2 filter-value" name="Q_endTime_DE"
                   placeholder="请输入" />
          </div>
        </div>
      </div>
      <div class="selchBtn">
        <a class="layui-btn layui-btn-sm fillBtn" lay-event="query">
          <span>查询</span>
        </a>
        <div class="layui-btn-group">
          <button type="button" class="layui-btn layui-btn-sm" lay-event="clears" style="width: 28px;font-size: 12px;padding: 0">
            <i class="iconfont data-iconcommon_refresh"></i>
          </button>
        </div>
      </div>
    </div>
  </form>
  </div>

</script>
<script src="${ctx}/qbdmsStatic/public/configFile.js"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>
  //一般直接写在一个js文件中
  layui.config({
    base: serverPath.qbdmsPath + staticPath.qbdmsPath //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(
      ['index', 'table', 'common',  'publicMethods', 'jquery', 'layer','propsHandle'],
      function () {
        var table = layui.table;
        var common = layui.common;
        var publicMethods = layui.publicMethods;
        var $ = layui.jquery;
        var layer = layui.layer;

        var tableH = publicMethods.tabHeight();
        var propsHandle = layui.propsHandle;
        var defProps = {
                  //viewMould: 'form/formDef/view/formDesign/moulds/', // 组件模块 存放文件 *****
                  viewMould: 'moulds/', // 组件模块 存放文件 *****
                  selectorBtn: '.selectorBtn'
                },
                temQuery = new propsHandle();  // 实例化模板功能部分
        temQuery.initTem({
          selectorBtn: defProps.selectorBtn,
          selectorTemPath: setter.views + defProps.viewMould
        });

        //第一个实例
        table.render({
          elem: '#zeroFaultInformationStatisticsTable'
          , height: tableH
          , url:  '${ctx}/qbdms/zeroFaultInformationStatistics/getChartData'
          , page: true //开启分页
          , toolbar: '#zeroFaultInformationStatisticsHeaderToolsBar'
          , method: 'post'
          ,defaultToolbar: ['']
          , autoSort: false //是否排序
          , limit: 20
          , cols: [[ //表头
            {field: 'sn', type: 'numbers', title: '序号', fixed: 'left'}
            , {field: 'FILLDEPTHOSPITAL', title: '数据来源单位', sort: false,minWidth:'150'}
            , {field: 'COUNTA', title: '组织进场次数', sort: false,minWidth:'140'}
            , {field: 'COUNTB', title: '靶场零故障次数', sort: false,minWidth:'140'}
            , {field: 'COUNTC', title: '组织进场型号数', sort: false,minWidth:'140'}
            , {field: 'COUNTD', title: '靶场零故障数', sort: false,minWidth:'140'}
            , {field: 'COUNTE', title: '飞行试验数', sort: false,minWidth:'130'}
            , {field: 'COUNTF', title: '靶场问题数', sort: false,minWidth:'130'}
          ]], done: function () {
            common.tableSelectCon('.ccpui-enterSel .layui-form input', 'a[lay-event=query]',
                '.ccpui-enterSel');
          }
        });

        dateReflash()

        function dateReflash() {
          publicMethods.reflashDate({startName: '.start_time2', endName: '.end_time2'});
        }

        function reflashQuery(isClear) {
          common.tableConditionRender("zeroFaultInformationStatisticsTable",
              "zeroFaultInformationStatisticsQueryForm",
              {where: {}}, isClear, false, 20);
          var originOrgList = eval('${originOrgList}'); //数据来源单位
          common.initDicData("Q_filldept_SL", originOrgList, "");
        }

        table.on('toolbar(zeroFaultInformationStatisticsTable)', function (obj) {
          switch (obj.event) {
            case 'export':

              var url = '${ctx}/qbdms/zeroFaultInformationStatistics/exportData';
              var param = "";
              $("form[lay-filter='zeroFaultInformationStatisticsQueryForm']").find(
                  ".filter-value").each(
                  function (i, value) {
                    param += "&" + this.name + "=" + this.value
                  });
              open(url, param);
              break;
            case "query":
              reflashQuery(false);
              dateReflash();
              break;
            case "clears":
              reflashQuery(true);
              dateReflash();
              break;

          }
          ;
        });
        function open(url, param) {
          var curUrl = url;
          layer.open({
            type: 2,
            area: ['700px', '520px'],
            title: ['自定义导出', 'font-size:14px;'],
            content: '${ctx}/qbdms/zeroFaultInformationStatistics/view/export',
            btnAlign: 'c',
            skin: 'qbdms-layerFormBtn',
            btn: ['确定', '取消'],
            yes: function (index, layero) {
              url = curUrl;
              var iframeWin = window["layui-layer-iframe" + index];
              var data = iframeWin.getData();
              if (data) {
                url = url + "?data=" + JSON.stringify(data) + param;
                window.location.href = encodeURI(url)
              }
            }
          });
        }
        /*刷新时间控件*/
        dateReflash();
      });
</script>
</body>
</html>